import functools
class Solution(object):
    def nimGame(self, piles):
        def yihuo(x, y):
            return x ^ y
        return functools.reduce(yihuo, piles) > 0